import request from '@/utils/request'

//从配置中获取业务的地址
import {baseUrlConfig} from '@/config/config'
const processBaseUrl = baseUrlConfig.processBaseUrl

// 导出
export const exportProjectList: (data: any) => Promise<[]> = (data) => {
  return request({
    url: processBaseUrl + '/cm/dailyConstruction/exportXls',
    method: 'post',
    responseType: "blob",
    data
  })
}
//分页获取申请列表
export const getApplyPageList: (data: any) => Promise<[]> = (data) => {
    return request({
        url: processBaseUrl + '/cm/dailyConstruction/find/page',
        method: 'post',
        data
    })
}

// 查询条件数量统计
export const getProjectConditionsStatNum: () => Promise<[]> = () => {
  return request({
      url: processBaseUrl + '/cm/dailyConstruction/queryTypeCountByWeb',
      method: 'post',
  })
}
// 分页获取项目列表
export const getProjectPageList: (data: any) => Promise<[]> = (data) => {
  return request({
      url: processBaseUrl + '/cm/dailyConstruction/getProjects',
      method: 'post',
      data
  })
}
// 新增施工申请
export const addApply: (data: any) => Promise<[]> = (data) => {
  return request({
      url: processBaseUrl + '/cm/dailyConstruction/append',
      method: 'post',
      data
  })
}

// 编辑施工申请
export const editApply: (data: any) => Promise<[]> = (data) => {
  return request({
      url: processBaseUrl + '/cm/dailyConstruction/change',
      method: 'post',
      data
  })
}

// 审核接口
export const examine: (data: any) => Promise<[]> = (data) => {
  return request({
      url: processBaseUrl + '/cm/dailyConstruction/approve',
      method: 'post',
      data
  })
}

/**
 * 获取每日施工申请详情
 * @param id 
 * @returns 
 */
export const getApplyDetail: (id: any) => Promise<[]> = (id) => {
  return request({
      url: processBaseUrl + `/cm/dailyConstruction/info/${id}`,
      method: 'get',
  })
}





